package com.quanyan.api.enums;

/**
 * Created by wmb on 2016/5/30.
 */
public enum AssetsType {

    ASSETS_EGGS(1,"鸟蛋"),
    ASSETS_SHELL(2,"鸟壳"),
    ASSETS_SUBSIDY(3,"红包"),
    ASSETS_COUPON(4,"卡券");
    AssetsType(Integer id, String name){
        this.id=id;
        this.name=name;
    }
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static AssetsType getById(Integer id) {
        if(null==id){
            return null;
        }
        for(AssetsType tmp: AssetsType.values()) {
            if(tmp.id.intValue() == id.intValue()) {
                return tmp;
            }
        }
        return null;
    }

    public static String getNameById(Integer id) {
        if(null==id){
            return null;
        }
        for(AssetsType tmp: AssetsType.values()) {
            if(tmp.id.intValue() == id.intValue()) {
                return tmp.getName();
            }
        }
        return null;
    }


    public Integer id;
    public String name;
}
